package com.fix.hellojava;

class ARunner extends Thread {
	String name;
	int speed;

	public ARunner(String name, int speed) {
		this.name = name;
		this.speed = speed;
		this.start();
	}

	@Override
	public void run() {
		for (int i = 0; i < 20; i++) {
			try {
				Thread.sleep(1000/speed);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println(name + "跑"+i);
		}
	}

}

public class Guitu {

	public static void main(String[] args) {
		// 龟兔赛跑
		ARunner tu= new ARunner("超级兔子", 3);
		ARunner gui= new ARunner("乌龟", 1);	

	}

}
